// astar.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>
#include "AstarNode.h"

namespace me {

	class MyClass
	{
	public:
		MyClass() :MyClass(0, "") {}
		MyClass(int x, std::string s) :str(s), index(x) {}
		std::string str;

		int index;

		bool operator<(const MyClass& rhs) const
		{
			return index < rhs.index;
		}

		friend void swap(MyClass& lhs, MyClass& rhs)
		{
			std::cout << "swap" << "\n";
			using std::swap;
			swap(lhs, rhs);
		}
	};



}	
using namespace me;
	
MyClass fn(int&& n)
{
	MyClass m = MyClass(n, "sss");
	std::cout << &m.str<<"\n";
	return m;
}
int sa = 5;

int&& rr5 = static_cast<int&&>(sa);
	
	std::list<MyClass> lm;
	std::list<MyClass> lm2;
	int&& rr = 12;
	int s = rr;
	int main()
	{
		auto m1 = MyClass(1, "a0");
		auto m2 = MyClass(2, "a2");
		auto m3 = MyClass(3, "a3");
		auto m4 = MyClass(4, "a4");
		lm.push_back(m2);
		lm.push_back(m1);
		lm.push_back(m4);
		lm.push_back(m3);
		lm2.swap(lm);
		for (auto i = lm.begin(); i != lm.end(); ++i)
		{
			std::cout << (*i).str;
		}
		lm2.sort();
		for (auto i = lm2.begin(); i != lm2.end(); ++i)
		{
			std::cout << (*i).str;
		}
		/*for (size_t i = 0; i < 150; i++)
		{
			AstarNode::SetDest(15, 15);
			AstarNode::SetField(20, 20);
			AstarNode* start = new AstarNode(15, 2);
			AstarNode::smallfn = start->getFn();
			AstarNode::openNodes.push_front(start);
			start->findNext();
			AstarNode::resetNodes();

		}*/
		return 0;
	}
